﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="HK_UserRightsList1.aspx.cs"
    Inherits="HK_UserRightsList1" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>恒康用户权限(商品中心)</title>
    <script src="./../js/extTools.js" type="text/javascript"></script>
    <script>
        var edit = function (editor, e) {
            // Call DirectMethod
            if (!(e.value === e.originalValue || (Ext.isDate(e.value) && Ext.Date.isEqual(e.value, e.originalValue)))) {
                CompanyX.Edit(e.record.data.mid, e.record.data.userid, e.field, e.originalValue, e.value, e.record.data);
            }
        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <ext:ResourceManager ID="ResourceManager1" runat="server" Theme="Default" />
        <ext:Viewport ID="Viewport1" runat="server">
            <LayoutConfig>
                <ext:HBoxLayoutConfig Align="Stretch" />
            </LayoutConfig>
            <Defaults>
                <ext:Parameter Name="margin" Value="2 0" Mode="Value" />
            </Defaults>
            <Items>
                <ext:Hidden ID="FormatType" runat="server" />
                <ext:Hidden ID="Hidden1" runat="server" />
                <ext:TabPanel runat="server" Width="260" CollapseDirection="Left">
                    <Items>
                        <ext:GridPanel ID="GridPanel2" runat="server" Title="用户列表" Width="260" CollapseDirection="Left">
                            <TopBar>
                                <ext:Toolbar ID="Toolbar1" runat="server">
                                    <Items>
                                        <ext:TextField runat="server" ID="txtuser" EmptyText="用户名/用户帐号/部门/角色" Width="200" />
                                        <ext:Button ID="Button1" runat="server" Text="查询" UI="Info">
                                            <DirectEvents>
                                                <Click OnEvent="Getdata">
                                                    <EventMask ShowMask="true" Msg="加载中...">
                                                    </EventMask>
                                                </Click>
                                            </DirectEvents>
                                        </ext:Button>
                                    </Items>
                                </ext:Toolbar>
                            </TopBar>
                            <Store>
                                <ext:Store ID="Store2" runat="server" PageSize="1000" OnReadData="MyData_Refresh">
                                    <Model>
                                        <ext:Model ID="Model2" runat="server" IDProperty="用户ID">
                                            <Fields>
                                                <ext:ModelField Name="用户ID" ServerMapping="UserID" />
                                                <ext:ModelField Name="用户编号" ServerMapping="UserCode" />
                                                <ext:ModelField Name="用户名称" ServerMapping="UserName" />
                                                <ext:ModelField Name="部门" ServerMapping="DepartMentName" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel>
                                <Columns>
                                    <ext:RowNumbererColumn ID="RowNumbererColumn2" runat="server" Width="35" Text="序号" />
                                    <ext:Column ID="Column1" runat="server" Text="编号" DataIndex="用户编号" Width="60" />
                                    <ext:Column ID="Column5" runat="server" Text="名称" DataIndex="用户名称" Width="60" />
                                    <ext:Column ID="Column10" runat="server" Text="所属部门" DataIndex="部门" />
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:RowSelectionModel ID="RowSelectionModel2" runat="server">
                                    <DirectEvents>
                                        <Select OnEvent="Cell_Click">
                                            <EventMask ShowMask="true" Msg="加载中..." />
                                        </Select>
                                    </DirectEvents>
                                </ext:RowSelectionModel>
                            </SelectionModel>
                            <BottomBar>
                                <ext:PagingToolbar ID="PagingToolbar2" runat="server">
                                    <Items>
                                        <ext:Label ID="Label2" runat="server" Text="每页显示:" />
                                        <ext:ToolbarSpacer ID="ToolbarSpacer2" runat="server" Width="10" />
                                        <ext:ComboBox ID="ComboBox2" runat="server" Width="80">
                                            <Items>
                                                <ext:ListItem Text="1000" />
                                            </Items>
                                            <SelectedItems>
                                                <ext:ListItem Value="1000" />
                                            </SelectedItems>
                                            <Listeners>
                                                <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                            </Listeners>
                                        </ext:ComboBox>
                                    </Items>
                                    <Plugins>
                                        <ext:ProgressBarPager ID="ProgressBarPager2" runat="server" />
                                    </Plugins>
                                </ext:PagingToolbar>
                            </BottomBar>
                        </ext:GridPanel>
                        <ext:GridPanel ID="GridPanel3" runat="server" Title="用户角色" Width="150" CollapseDirection="Left">
                            <Store>
                                <ext:Store ID="Store3" runat="server" PageSize="20" OnReadData="MyData_Refresh">
                                    <Model>
                                        <ext:Model ID="Model3" runat="server" IDProperty="用户ID">
                                            <Fields>
                                                <ext:ModelField Name="角色名称" ServerMapping="RoleName" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel>
                                <Columns>
                                    <ext:Column ID="Column12" runat="server" Text="角色名称" DataIndex="角色名称" Width="180" />
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:RowSelectionModel ID="RowSelectionModel3" runat="server" />
                            </SelectionModel>
                        </ext:GridPanel>
                    </Items>
                </ext:TabPanel>
                <ext:GridPanel ID="GridPanel1" runat="server" Title="权限列表" Width="200" CollapseDirection="Left"
                    Flex="1" Split="true">
                    <TopBar>
                        <ext:Toolbar ID="Toolbar2" runat="server" Layout="ColumnLayout" Padding="5">
                            <Items>
                                <ext:TextField runat="server" FieldLabel="条件" LabelWidth="60" ID="txtmode" EmptyText="输入模块名称" />
                                <ext:Button ID="Button2" runat="server" Text="查询" UI="Info">
                                    <DirectEvents>
                                        <Click OnEvent="Cell_Click">
                                            <EventMask ShowMask="true" Msg="加载中...">
                                            </EventMask>
                                        </Click>
                                    </DirectEvents>
                                </ext:Button>
                            </Items>
                        </ext:Toolbar>
                    </TopBar>
                    <Store>
                        <ext:Store ID="Store1" runat="server" PageSize="100" OnReadData="MyData_Refresh"
                            OnSubmitData="Store1_Submit">
                            <Model>
                                <ext:Model ID="Model1" runat="server" IDProperty="ModuleCode">
                                    <Fields>
                                        <ext:ModelField Name="ModuleCode" ServerMapping="ModuleCode" />
                                        <ext:ModelField Name="ModuleName" ServerMapping="ModuleName" />
                                        <ext:ModelField Name="IsBrowse" ServerMapping="IsBrowse" />
                                        <ext:ModelField Name="IsInsert" ServerMapping="IsInsert" />
                                        <ext:ModelField Name="IsEdit" ServerMapping="IsEdit" />
                                        <ext:ModelField Name="IsDelete" ServerMapping="IsDelete" />
                                        <ext:ModelField Name="IsExcel" ServerMapping="IsExcel" />
                                        <ext:ModelField Name="IsPrint" ServerMapping="IsPrint" />
                                        <ext:ModelField Name="IsAudit" ServerMapping="IsAudit" />
                                        <ext:ModelField Name="IsBackAudit" ServerMapping="IsBackAudit" />
                                    </Fields>
                                </ext:Model>
                            </Model>
                        </ext:Store>
                    </Store>
                    <ColumnModel>
                        <Columns>
                            <ext:RowNumbererColumn ID="RowNumbererColumn1" runat="server" Width="35" Text="序号" />
                            <ext:Column ID="Column4" runat="server" Text="模块名称" DataIndex="ModuleName" Width="150" />
                            <ext:CheckColumn ID="CheckColumn1" runat="server" Text="浏览" DataIndex="IsBrowse"
                                Width="50" />
                            <ext:CheckColumn ID="Column2" runat="server" Text="新增" DataIndex="IsInsert" Width="50" />
                            <ext:CheckColumn ID="Column7" runat="server" Text="修改" DataIndex="IsEdit" Width="50" />
                            <ext:CheckColumn ID="Column8" runat="server" Text="删除" DataIndex="IsDelete" Width="50" />
                            <ext:CheckColumn ID="Column9" runat="server" Text="导出" DataIndex="IsExcel" Width="50" />
                            <ext:CheckColumn ID="CheckColumn2" runat="server" Text="打印" DataIndex="IsPrint" Width="50" />
                            <ext:CheckColumn ID="CheckColumn3" runat="server" Text="审核" DataIndex="IsAudit" Width="50" />
                            <ext:CheckColumn ID="CheckColumn4" runat="server" Text="反审核" DataIndex="IsBackAudit"
                                Width="50" />
                        </Columns>
                    </ColumnModel>
                    <SelectionModel>
                        <ext:RowSelectionModel ID="RowSelectionModel1" runat="server">
                            <DirectEvents>
                                <Select OnEvent="Cell_Click2">
                                    <EventMask ShowMask="true" Msg="加载中..." />
                                </Select>
                            </DirectEvents>
                        </ext:RowSelectionModel>
                    </SelectionModel>
                    <Plugins>
                        <ext:CellEditing ID="CellEditing1" runat="server">
                            <Listeners>
                                <Edit Fn="edit" />
                            </Listeners>
                        </ext:CellEditing>
                    </Plugins>
                    <BottomBar>
                        <ext:PagingToolbar ID="PagingToolbar1" runat="server">
                            <Items>
                                <ext:Label ID="Label1" runat="server" Text="每页显示:" />
                                <ext:ToolbarSpacer ID="ToolbarSpacer1" runat="server" Width="10" />
                                <ext:ComboBox ID="ComboBox1" runat="server" Width="80">
                                    <Items>
                                        <ext:ListItem Text="100" />
                                        <ext:ListItem Text="200" />
                                    </Items>
                                    <SelectedItems>
                                        <ext:ListItem Value="100" />
                                    </SelectedItems>
                                    <Listeners>
                                        <Select Handler="#{GridPanel1}.store.pageSize = parseInt(this.getValue(), 10); #{GridPanel1}.store.reload();" />
                                    </Listeners>
                                </ext:ComboBox>
                                <ext:Button ID="Button3" runat="server" Text="导出Excel" Icon="PageExcel" Visible="true">
                                    <Listeners>
                                        <Click Handler="exportData('xls');" />
                                    </Listeners>
                                </ext:Button>
                            </Items>
                            <Plugins>
                                <ext:ProgressBarPager ID="ProgressBarPager1" runat="server" />
                            </Plugins>
                        </ext:PagingToolbar>
                    </BottomBar>
                </ext:GridPanel>
                <ext:Panel runat="server" CollapseDirection="Left" Width="220" Split="true" Layout="BorderLayout">
                    <Items>
                        <ext:GridPanel ID="GridPanel4" runat="server" Title="数据权限" Width="150" CollapseDirection="Left"
                            Region="North" Height="220" EmptyText="没有数据！">
                            <Store>
                                <ext:Store ID="Store4" runat="server" PageSize="20" OnReadData="MyData_Refresh">
                                    <Model>
                                        <ext:Model ID="Model4" runat="server" IDProperty="DataItemID">
                                            <Fields>
                                                <ext:ModelField Name="DataItemID" ServerMapping="DataItemID" />
                                                <ext:ModelField Name="DataItemName" ServerMapping="DataItemName" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel>
                                <Columns>
                                    <ext:Column ID="Column3" runat="server" Text="数据权限" DataIndex="DataItemName" Width="180" />
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:RowSelectionModel ID="RowSelectionModel4" runat="server">
                                    <DirectEvents>
                                        <Select OnEvent="Cell_Click3">
                                            <EventMask ShowMask="true" Msg="加载中..." />
                                        </Select>
                                    </DirectEvents>
                                </ext:RowSelectionModel>
                            </SelectionModel>
                        </ext:GridPanel>
                        <ext:GridPanel ID="GridPanel5" runat="server" Title="数据权限明细" Width="150" CollapseDirection="Left"
                            Region="Center" EmptyText="没有数据！">
                            <Store>
                                <ext:Store ID="Store5" runat="server" PageSize="20" OnReadData="MyData_Refresh">
                                    <Model>
                                        <ext:Model ID="Model5" runat="server" IDProperty="用户ID">
                                            <Fields>
                                                <ext:ModelField Name="数据权限明细" ServerMapping="name" />
                                            </Fields>
                                        </ext:Model>
                                    </Model>
                                </ext:Store>
                            </Store>
                            <ColumnModel>
                                <Columns>
                                    <ext:RowNumbererColumn ID="RowNumbererColumn3" runat="server" Width="35" Text="序号" />
                                    <ext:Column ID="Column6" runat="server" Text="数据权限明细" DataIndex="数据权限明细" Width="180" />
                                </Columns>
                            </ColumnModel>
                            <SelectionModel>
                                <ext:RowSelectionModel ID="RowSelectionModel5" runat="server" />
                            </SelectionModel>
                        </ext:GridPanel>
                    </Items>
                </ext:Panel>
            </Items>
        </ext:Viewport>
    </div>
    </form>
</body>
</html>
